<!DOCTYPE html>
<html>
<head>
  <title>
    test setting file input value
  </title>
</head>
<body>
  <input id = 'input0' type = 'file'/>
  <script type="text/javascript">
    var gui = require('nw.gui');
    var win = gui.Window.get();
    var path = require('path');
    win.on('loaded',function(){
      try{
        var f = new File(global.tests_dir+'filevalue/testfile', 'mytestfile');
        var files = new FileList();
        files.append(f);
        document.getElementById('input0').files = files;
      } catch(er){
        console.log(er);
      } finally{
        var info = 'wrong';
        if(document.getElementById('input0').files[0] != null)
          info = document.getElementById('input0').files[0].name;
        var client = require('../../nw_test_app').createClient({
          argv : gui.App.argv,
          data : info,
        })
      }
    })
  </script>
</body>
</html>